package org.example;

/**
 * 算式类的手动测试类
 */
public class ArithmeticExpressionTestMain {
    public static void main(String[] args) {
        // 测试加法算式
        ArithmeticExpression addExp = new ArithmeticExpression(2, 3, '+');
        System.out.println("算式：" + addExp.getExpressionStr() + "，正确结果：" + addExp.getResult());
        System.out.println("验证答案5：" + addExp.checkAnswer(5)); // 预期true

        // 测试除法算式
        ArithmeticExpression divExp = new ArithmeticExpression(5, 2, '/');
        System.out.println("算式：" + divExp.getExpressionStr() + "，正确结果：" + divExp.getResult());
        System.out.println("验证答案2.5：" + divExp.checkAnswer(2.5)); // 预期true
    }
}
